function render(data = []) {
    let html = ""; 
    data.forEach(item => {
        html += `
        <li productid=${item.productId}>
           <a href="#">
             <div class="img f1">
                 ${item.productImg2}
             </div>
        <div class="infoR">
            <div class="title">
                <h4>${item.productName}
                <span>${item.productPinkage}</span>
                </h4>
            </div>
        <div class="other">
            <span class="mall f1">${item.productFrom}|${item.productTime}</span>
            <i>${item.productComCount}</i>
        </div>
           </div>
        </a>
        </li>
        `
    })

       $("ul").html(html)

    


    

    $("#info div:nth-child(8)").click(function() {
        $("#info div:nth-last-child(-n+4)").finish().slideToggle(200)

    });
}

$.ajax({
        url: "http://chst.vip:1234/api/getmoneyctrl"
    })
    .then(res => {
        render(res.result)
        $("ul").on("click", "li", function() {
            let productid = $(this).attr("productid")
            location.href = `./pages/discount.html?productid=${productid}`
        })
    })



// 返回顶部
$(".right").click(function() {
    $("body,html").animate({ scrollTop: 0 }, 500)
    console.log("aaa")
})